#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "List.hpp"
#include "SeqStack.hpp"
#include "Queue.hpp"

typedef LinkedList<int> LinkedList_int;
typedef SeqStack<int> Stack_int;

void test_list() {
	auto list = LinkedList_int(0, (LinkedList_int*)NULL);
	for (int i = 0; i < 5; i++)
		list.push(i);
	auto head = list.next;
	while (head)
	{
		printf("%d ", head->data);
		head = head->next;
	}
	printf("\n");
}

void test_stack() {
	auto s = Stack_int(10);
	int x = 0;
	for (int i = 0; i < 5; i++)
		s.push(i);
	while (!s.isEmpty()) {
		if (s.pop(x))
			printf("%5d", x);
	}
	printf("\n");
}

void test_queue() {
	auto q = new Queue<int>();
	for (int i = 0; i < 10; i++)
		q->enqueue(i);
	while (!q->isEmpty())
		printf("%d ", q->dequeue());
	delete q;
}

int main() {
	test_list();
	test_stack();
	test_queue();
	return 0;
}